<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<base href="${base}" />
<meta charset="UTF-8" />
<title>企业会员中心 - 人才系统</title>
<link rel="shortcut icon" href="favicon.ico" />
<link href="styles/user.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<jsp:include page="../header.jsp"></jsp:include>
	<!--导航 -->
	<div class="floatnav">
		<jsp:include page="../nav.jsp"></jsp:include>
	</div>
	<!--导航end -->
	<div class="page_location link_bk">

		当前位置：<a href="">首页</a>&nbsp;>>&nbsp;<a href="company_index.php">会员中心</a>
		&nbsp;>>&nbsp;公司信息 &nbsp;>>&nbsp;营业执照
	</div>
	<table width="985" border="0" align="center" cellpadding="0"
		cellspacing="0" style="margin-top: 8px;">
		<tr>
			<td width="173" valign="top" class="link_bk"><jsp:include
					page="left.jsp"></jsp:include></td>
			<td valign="top">
				<div class="user_right_box">
					<div class="user_right_top_tit_bg">
						<h1>营业执照</h1>
					</div>
					<form action="/company/permits" method="post" enctype="multipart/form-data"
						id="Form1">
						<table width="100%" border="0" cellpadding="4" cellspacing="0"
							bgcolor="#FFFFFF" style="margin-bottom: 100px;">

							<tr>
								<td height="30" colspan="2" bgcolor="#FFFFFF"
									style="padding-left: 20px; color: #009900; line-height: 200%;"
									class="link_lan">营业执照只作为网站核实贵公司真实性的材料，不在任何页面显示，我们不会以任何形式公布您的执照信息！<br />
									通过网站核实后营业执照我们将立即删除。<span id="spanshow"
									style="color: #0066CC; cursor: pointer">[为什么要上传营业执照?]</span></td>
							</tr>
							<tr id="why" style="display: none">
								<td width="139" height="30" align="right" bgcolor="#EAF4F7">为什么要上传营业执照：</td>
								<td width="595" bgcolor="#EAF4F7" style="line-height: 200%">①
									通过认证后您将获得更多权限；<br /> ② 通过认证后可额外获得 15 点积分；<br /> ③
									通过认证后可增加信息的可信度，成为<strong>已认证企业</strong>；<br />
									注：上传营业执照仅供我们审核，绝不会用任何形式对外公开。
								</td>
							</tr>
							<tr>
								<td width="139" height="30" align="right" bgcolor="#FFFFFF">您的营业执照认证状态：</td>


								<c:if  test="${company.permit eq null}">
									<td width="595" bgcolor="#FFFFFF" style="color: #FF0000">
									未上传营业执照，请上传！ &nbsp;</td>
								</c:if>
								<c:if  test="${company.permit ne null}">
									<td width="595" bgcolor="#FFFFFF" style="color: #FF0000">
										已经成功上传！ &nbsp;</td>
								</c:if>
							</tr>

							<tr>
								<td height="30" align="right" bgcolor="#FFFFFF">上传执照图片：</td>
								<td bgcolor="#FFFFFF"><div class="layui-upload">
									<button type="button" class="layui-btn" id="test1">上传图片</button>
									<input type="submit" name="Submit" value="立即上传" id="up" class="layui-btn"/>
									<div class="layui-upload-list">
										<img class="layui-upload-img" id="demo1" style="height: 300px;width: 300px">
										<p id="demoText"></p>
									</div>
								</div> (图片大小不超过 1024 KB,允许格式：jpg/gif/bmp/png)<br />
								</td>

							</tr>

						</table>
						<input type="text" id="img" value="" name="img">
					</form>
				</div>
			</td>
		</tr>
	</table>
	<jsp:include page="../footer.jsp"></jsp:include>
	<link rel="stylesheet" href="layui/css/layui.css"  media="all">
	<script src="layui/layui.js" charset="utf-8"></script>
	<script src="js/jquery-2.0.3.js"></script>

	<script>
		layui.use('upload', function(){
			var $ = layui.jquery
					,upload = layui.upload;

			//普通图片上传
			var uploadInst = upload.render({
				elem: '#test1'
				,url: '/files/permit'
				,before: function(obj){
					//预读本地文件示例，不支持ie8
					obj.preview(function(index, file, result){
						$('#demo1').attr('src', result); //图片链接（base64）
					});
				}
				,done: function(res){
					//如果上传失败
					console.log(res.code)
					if(res.code = 200){
						$("#img").val(res.data)
						return layer.msg('上传成功');
					}
					//上传失败
				}
				,error: function(){
					//演示失败状态，并实现重传
					var demoText = $('#demoText');
					demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
					demoText.find('.demo-reload').on('click', function(){
						uploadInst.upload();
					});
				}
			});
		})
	</script>
</body>
</html>